# -*- coding: utf-8 -*-
# @Time    : 2019/5/13 16:29
# @Author  : Igor
# @File    : demo.py
# @Software: PyCharm

import threading
import time


def fun(message):
    print("我想看{} {}".format(message,time.ctime()))
    time.sleep(3)
    print(message+"看完了"+time.ctime())


def fun2(message):
    print("我听看{} {}".format(message, time.ctime()))
    time.sleep(6)
    print(message+"看完了"+time.ctime())


new_list = []
t1 = threading.Thread(target=fun, args=("电影",))
new_list.append(t1)
t2 = threading.Thread(target=fun, args=("音乐",))
new_list.append(t2)

for i in new_list:
    #i.setDaemon(True)
    """
    线程守护，主线程执行完毕后，其他线程都不执行了
    """
    i.start()
#t2.join()
"""
加入join表示先等t2执行完后，再执行其他的线程
"""
print("休息了")

